import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/Index.vue"
import Detail from "../views/Detail.vue"
import Movie from "../views/Movie.vue";
import Cinema from "../views/Cinema.vue"
import BoxOffice from "../views/BoxOffice.vue"
import My from "../views/My.vue"
import Demo from "../views/Demo.vue"
Vue.use(VueRouter)



const router = new VueRouter({
  routes:[
    {
      path:"/",
      redirect:{
        name:"Movie"
      }
    },
    {
      path:"/Index",
      name:"Index",
      component:Index,
      //路由里面的meta可以理解为路由的自定义信息
      meta:{
        keepAlive:true
      },
      children:[
        {path:"Movie",name:"Movie",component:Movie,meta:{keepAlive:true}},
        {path:"Cinema",name:"Cinema",component:Cinema,meta:{keepAlive:true}},
        {path:"BoxOffice",name:"BoxOffice",component:BoxOffice,meta:{keepAlive:true}},
        {path:"My",name:"My",component:My,meta:{keepAlive:true}}
      ]
    },{
      path:"/Detail",
      name:"Detail",
      component:Detail
    },{
      path:"/Demo",
      name:"Demo",
      component:Demo
    }
  ]
})

export default router
